import service from '@/utils/request'

// @Tags Enterprise
// @Summary 创建企业
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Enterprise true "创建企业"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /enterprise/createEnterprise [post]
export const createEnterprise = (data) => {
  return service({
    url: '/enterprise/createEnterprise',
    method: 'post',
    data
  })
}

// @Tags Enterprise
// @Summary 删除企业
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Enterprise true "删除企业"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /enterprise/deleteEnterprise [delete]
export const deleteEnterprise = (data) => {
  return service({
    url: '/enterprise/deleteEnterprise',
    method: 'delete',
    data
  })
}

// @Tags Enterprise
// @Summary 批量删除企业
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除企业"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /enterprise/deleteEnterprise [delete]
export const deleteEnterpriseByIds = (data) => {
  return service({
    url: '/enterprise/deleteEnterpriseByIds',
    method: 'delete',
    data
  })
}

// @Tags Enterprise
// @Summary 更新企业
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Enterprise true "更新企业"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /enterprise/updateEnterprise [put]
export const updateEnterprise = (data) => {
  return service({
    url: '/enterprise/updateEnterprise',
    method: 'put',
    data
  })
}

// @Tags Enterprise
// @Summary 用id查询企业
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Enterprise true "用id查询企业"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /enterprise/findEnterprise [get]
export const findEnterprise = (params) => {
  return service({
    url: '/enterprise/findEnterprise',
    method: 'get',
    params
  })
}

// @Tags Enterprise
// @Summary 分页获取企业列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取企业列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /enterprise/getEnterpriseList [get]
export const getEnterpriseList = (params) => {
  return service({
    url: '/enterprise/getEnterpriseList',
    method: 'get',
    params
  })
}
